<!DOCTYPE html>
<html>
<!-- <html xmlns:th="http://www.thymeleaf.org"> -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>清分临时信息 - 车道出口交易(编辑)</title>

    <link rel="stylesheet" th:href="@{/static/iview/iview.css}">
    <script th:src="@{/static/libs/jquery-3.2.1.min.js}" type="text/javascript"></script>
	<script th:src="@{/static/libs/vue.min.js}" type="text/javascript"></script>
	<script th:src="@{/static/layer/layer.js}" type="text/javascript"></script>
	<script th:src="@{/static/iview/iview.min.js}" type="text/javascript"></script>
    <style type="text/css">
	[v-cloak] {
			  display: none;
			}
			
			.ivu-input{
			   width:100%;
			}
			
	</style>
</head>
<body>
<div id="app"  v-cloak style="margin: 30px">
 <template>
	    <i-form v-ref:form-property :model="formProperty" :rules="ruleValidate" :label-width="80">
	      <Row>
		        <Form-item label="主键标识" prop="id">
		            <i-input  v-model="formProperty.id"  :value.sync="formProperty.id" readonly="readonly"  placeholder="请输入主键标识"></i-input>
		        </Form-item>
	        </Row>
	        
	
	          <Row>
		            <Form-item label="鉴权码" prop="authCode">
		            <i-input  v-model="formProperty.authCode"  :value.sync="formProperty.authCode" placeholder="请输入鉴权码" ></i-input>
		        </Form-item>
	        </Row>
	        
	        <Row>
		            <Form-item label="类型" prop="dataType">
		             <i-select  v-model="formProperty.dataType">
		                 <i-option v-for="item in dataTypeList"  :value="item.data_type"  :key="item.business_name">{{item.data_type}} - {{item.business_name}}</i-option>
		             </i-select>
		        </Form-item>
		     </Row>
		        
		    <Row>
		            <Form-item label="业务名称" prop="businessName">
		            <i-input  v-model="formProperty.businessName"  :value.sync="formProperty.businessName" placeholder="请输入业务名称" ></i-input>
		        </Form-item>
	        </Row>
	        
	        <Row>
		            <Form-item label="地址" prop=" urlPathPrefix">
		            <i-input  v-model="formProperty.urlPathPrefix"  :value.sync="formProperty.urlPathPrefix" placeholder="请输入地址" ></i-input>
		        </Form-item>
	        </Row>
	        
	         <Row>
		            <Form-item label="发送方向" prop="sendCode">
		            <i-input  v-model="formProperty.sendCode"  :value.sync="formProperty.sendCode" placeholder="请输入发送方向" ></i-input>
		        </Form-item>
	        </Row>
	        
	        
	         <Row>
		            <Form-item label="状态" prop="status">
		            <i-input  v-model="formProperty.status"  :value.sync="formProperty.status" placeholder="请输入地址" ></i-input>
		        </Form-item>
	        </Row>
	        
	         <Row>
		            <Form-item label="创建人" prop=" createUser">
		            <i-input  v-model="formProperty.createUser"  :value.sync="formProperty.createUser" placeholder="请输入地址" ></i-input>
		        </Form-item>
	        </Row>      
	    </i-form>
</template>
</div>
<script type="text/javascript">
var vm = new Vue({
	el : '#app',
	data : {
		formProperty: {
			id:"",
			authCode:"",
			dataType:"",
		    businessName:"",
		    urlPathPrefix:"",
		    sendCode:"",
		    status:"",
		    createUser:""
        },
        dataTypeList:'',
        ruleValidate: {
        	id: [
                { required: true, message: '交易编号不能为空', trigger: 'blur' }
            ],
            authCode: [
                { required: true, message: '鉴权码不能为空', trigger: 'blur' }
            ],
            dataType: [
                { required: true, message: '类型不能为空', trigger: 'blur' }
            ],
            businessName: [
                { required: true, message: '业务名称不能为空', trigger: 'blur' }
            ], 
            urlPathPrefix: [
                { required: true, message: '地址不能为空', trigger: 'blur' }
            ],
            sendCode: [
                { required: true, message: '发送方向不能为空', trigger: 'blur' }
            ],
            status: [
                { required: true, message: '状态不能为空', trigger: 'blur' }
            ],
            createUser: [
                { required: true, message: '创建人不能为空', trigger: 'blur' }
            ],
        }
	},
	methods : {
		//新建任务(略简单)
		acceptClick : function(){
			console.warn(2222);
		  //Validate不起作用MD
		  //var formProperty =  vm.form;
		  if(vm.formProperty.id==""||vm.formProperty.authCode==""||vm.formProperty.dataType==""
				  ||vm.formProperty.businessName==""||vm.formProperty.urlPathPrefix==""  ||vm.formProperty.sendCode==""){
			  alert("请输入以上完整信息");
			  return;
		  }
		
		  var params = {};
		  params["id"] = this.formProperty.id; 
		  params["authCode"] = this.formProperty.authCode; 
		  params["dataType"] = this.formProperty.sendCode; 
		  params["businessName"] = this.formProperty.businessName; 
		  params["urlPathPrefix"] = this.formProperty.urlPathPrefix; 
		  params["sendCode"] = this.formProperty.sendCode; 
		  params["status"] = this.formProperty.status;
		  params["createUser"] = this.formProperty.createUser;
		
		  var  conditional = {};
		  conditional['params'] = params;
		  
		  $.ajax({
				url:"../monitor/saveA22UrlMapping",
				type:"post",
				data: JSON.stringify(conditional),
				contentType: 'application/json', 
				success: function(data) {
					if(data.err_code=="200"){
						alert(1);
						$(window.parent.document).contents().find('#app')[0].contentWindow.vm.loadlist(0);
					}else{
						vm.$Notice.error({
		                    desc:  '系统异常'
		                });
					}
				}
			});
		}
	},
	created : function() {
		$.ajax({
			url:"../monitor/loadA22UrlMappingDataType",
			type:"get",
			success: function(data) {
				if(data.err_code=="200"){
					vm.dataTypeList = data.result; 
				}
			}
		});
	}
})
</script>
</body>
</html>